package com.smcdd.cdb.dbo.cdb_dbo.network;

import android.telephony.gsm.GsmCellLocation;

import com.google.gson.Gson;
import com.smcdd.cdb.dbo.cdb_dbo.service.entity.BaseResponseEntity;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;

/**
 * 作者：Administrator on 2017/6/30 16:57
 * 邮箱：zhanghuaiha@gmail.com
 */

public class ResponseInterceptor implements Interceptor {

    /*
    此interceptor用于处理每次请求中header中数据问题
    本例用于获取header中Set-Cookie参数值
    cookie未更新，导致注销登录时，再次登录还以原始用户
     */
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        Response response = chain.proceed(request);
        ResponseBody body = response.body();
        return response;
    }
}
